<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="<?php echo base_url('public_source/css_source/center_contend.css')?>" rel="stylesheet" type="text/css">
        <title></title>
        <script src="<?php echo base_url('public_source/javascript/jquery-1.9.1.js')?>" type="text/javascript"></script>
        <script>
            $(document).ready(function(){
                    $("#select1").change(function(){
                    var macasi = $("#select1").val();
                    var name = {
                        mahang : macasi
                    };
                    $.ajax({
                            type: "POST",
                            url: "<?php echo site_url("home/findProduct"); ?>",
                            data: name,
                            async: false,
                            beforeSend: function(){
                                    $("#div").html("");
                            }, 
                            success: function(kq){
                                    $("#div").html(kq);
                            }
                    });
                    var maalbum = $("#select2").val();
                    var name = {
                        madong : maalbum
                    };
                    $.ajax({
                            type: "POST",
                            url: "<?php echo site_url("home/findProduct"); ?>",
                            data: name,
                            async: true,
                            beforeSend: function(){
                                    $("#Contend_Ajax").html("");
                            }, 
                            success: function(kq){
                                    $("#Contend_Ajax").html(kq);
                            }
                    });
                    return false;
                });
            });
        </script>
    </head>
    <body>
        <div ID="Center_Contend">
            <div ID="ProductMain">
                <div ID="ProductMain_Image">
                    <img src="<?php echo base_url("public_source/images_source/title_product.png") ?>">
                    <div ID="ProductMain_Title">
                        Sản phẩm
                    </div>
                </div>
                <div ID="ProductMain_Border">
                    <?php if($sta == "1") {?>
                    <div id="Form_Find" style="width: 100%;background-color: #ededed; font-size: 13px; color: #666"> 
                        <table cellspacing="20px">
                            <tr>
                                <td>Hãng sản xuất</td>
                                <td>
                                    <select id="select1">              
                                        <?php 
                                            foreach ($hang as $item)
                                            {
                                                echo "<option value='".$item["fldMaHang"]."'>";
                                                echo $item["fldTenHang"];
                                                echo "</option>";
                                            }
                                        ?>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td>Model sản xuất</td>
                                <td>
                                    <div id="div">
                                        <?php $this->load->view("find/model_view"); ?>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <?php }else{ ?>
                    <?php if (isset($sp)){ ?>
                    <div>Kết quả tìm kiếm với <strong>'<?php echo $ten ?>'</strong> gồm có <strong><?php echo count($sp) ?></strong> sản phẩm</div>
                    <?php }
                    else{?><div>Kết quả tìm kiếm với <strong>'<?php echo $ten ?>'</strong> gồm có 0 sản phẩm</div>
                        <?php }
                    } ?>
                     <?php $this->load->view("find/load_product_1");?>
                </div>
            </div>
        </div>
    </body>
</html>